package com.huawei.gamebox.service.welfare.gift.card;

import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import com.huawei.gamebox.service.common.cardkit.card.BaseGsCard;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import o.exp$g;

public class BaseGiftCard extends BaseGsCard {
    private boolean ˋ = false;
    private List<BaseGsCard> ˎ = new ArrayList();
    public Context ॱ;

    public BaseGiftCard(Context context) {
        super(context);
        this.ॱ = context;
    }

    public BaseGsCard ˊ(int i) {
        if (i < 0 || i >= this.ˎ.size()) {
            return null;
        }
        return (BaseGsCard) this.ˎ.get(i);
    }

    public void ˋ(BaseGsCard baseGsCard) {
        if (baseGsCard != null) {
            this.ˎ.add(baseGsCard);
        }
    }

    public int ˋ() {
        return this.ˎ.size();
    }

    protected String ॱ(int i) {
        int i2;
        if ("zh".equals(ˊ(this.ॱ))) {
            if (10000 > i) {
                return String.valueOf(i);
            }
            i2 = i / 10000;
        } else if (1000 > i) {
            return String.valueOf(i);
        } else {
            i2 = i / 1000;
        }
        return this.ॱ.getResources().getQuantityString(exp$g.ॱ, i2, new Object[]{Integer.valueOf(i2)});
    }

    private String ˊ(Context context) {
        String str = "";
        Resources resources = context.getResources();
        if (resources == null) {
            return str;
        }
        Configuration configuration = resources.getConfiguration();
        if (configuration == null) {
            return str;
        }
        Locale locale = configuration.locale;
        if (locale != null) {
            return locale.getLanguage();
        }
        return str;
    }

    protected boolean ˎ() {
        return this.ˋ;
    }

    public void ˊ(boolean z) {
        this.ˋ = z;
    }
}
